<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport"
	      content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>Document</title>
	<style>
		#c1{
			border: 1px solid #e0e0e0;
			background: #f5f5f5;
		}
	</style>
</head>
<body>
<canvas id="c1" width="600" height="400"></canvas>
<script>
window.onload = function () {
	let oC = document.getElementById('c1');
	let gd = oC.getContext('2d');   //图形上下文--绘图接口

	gd.moveTo(100,100);
	gd.lineTo(100,200);
	gd.strokeStyle='red';
	gd.stroke();

}
</script>
</body>
</html>